#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N];
signed main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    // 枚举第i个年糕，求有多少个年糕可以被i放在上面
    int x = a[i] * 2; // 放的年糕必须满足 >= 2*a[i]
    int pos = lower_bound(a + 1, a + 1 + n, x) - a;
    ans += n - pos + 1;
  }
  cout << ans << endl;

  return 0;
}